home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / include / txmgr / nsITransaction.h next >
C/C++ Source or Header  |  2006-05-08  |  6KB  |  174 lines

  1. /*
  2.  * DO NOT EDIT.  THIS FILE IS GENERATED FROM nsITransaction.idl
  3.  */
  4.  
  5. #ifndef __gen_nsITransaction_h__
  6. #define __gen_nsITransaction_h__
  7.  
  8.  
  9. #ifndef __gen_nsISupports_h__
  10. #include "nsISupports.h"
  11. #endif
  12.  
  13. /* For IDL files that don't want to include root IDL files. */
  14. #ifndef NS_NO_VTABLE
  15. #define NS_NO_VTABLE
  16. #endif
  17.  
  18. /* starting interface:    nsITransaction */
  19. #define NS_ITRANSACTION_IID_STR "58e330c1-7b48-11d2-98b9-00805f297d89"
  20.  
  21. #define NS_ITRANSACTION_IID \
  22.   {0x58e330c1, 0x7b48, 0x11d2, \
  23.     { 0x98, 0xb9, 0x00, 0x80, 0x5f, 0x29, 0x7d, 0x89 }}
  24.  
  25. class NS_NO_VTABLE nsITransaction : public nsISupports {
  26.  public: 
  27.  
  28.   NS_DEFINE_STATIC_IID_ACCESSOR(NS_ITRANSACTION_IID)
  29.  
  30.   /**
  31.    * Executes the transaction.
  32.    */
  33.   /* void doTransaction (); */
  34.   NS_IMETHOD DoTransaction(void) = 0;
  35.  
  36.   /**
  37.    * Restores the state to what it was before the transaction was executed.
  38.    */
  39.   /* void undoTransaction (); */
  40.   NS_IMETHOD UndoTransaction(void) = 0;
  41.  
  42.   /**
  43.    * Executes the transaction again. Can only be called on a transaction that
  44.    * was previously undone.
  45.    * <P>
  46.    * In most cases, the redoTransaction() method will actually call the
  47.    * doTransaction() method to execute the transaction again.
  48.    */
  49.   /* void redoTransaction (); */
  50.   NS_IMETHOD RedoTransaction(void) = 0;
  51.  
  52.   /**
  53.    * The transaction's transient state. This attribute is checked by
  54.    * the transaction manager after the transaction's Execute() method is called.
  55.    * If the transient state is false, a reference to the transaction is
  56.    * held by the transaction manager so that the transactions' undoTransaction()
  57.    * and redoTransaction() methods can be called. If the transient state is
  58.    * true, the transaction manager returns immediately after the transaction's
  59.    * doTransaction() method is called, no references to the transaction are
  60.    * maintained. Transient transactions cannot be undone or redone by the
  61.    * transaction manager.
  62.    */
  63.   /* readonly attribute boolean isTransient; */
  64.   NS_IMETHOD GetIsTransient(PRBool *aIsTransient) = 0;
  65.  
  66.   /**
  67.    * Attempts to merge a transaction into "this" transaction. Both transactions
  68.    * must be in their undo state, doTransaction() methods already called. The
  69.    * transaction manager calls this method to coalesce a new transaction with
  70.    * the transaction on the top of the undo stack.
  71.    * This method returns a boolean value that indicates the merge result.
  72.    * A true value indicates that the transactions were merged successfully,
  73.    * a false value if the merge was not possible or failed. If true,
  74.    * the transaction manager will Release() the new transacton instead of
  75.    * pushing it on the undo stack.
  76.    * @param aTransaction the previously executed transaction to merge.
  77.    */
  78.   /* boolean merge (in nsITransaction aTransaction); */
  79.   NS_IMETHOD Merge(nsITransaction *aTransaction, PRBool *_retval) = 0;
  80.  
  81. };
  82.  
  83. /* Use this macro when declaring classes that implement this interface. */
  84. #define NS_DECL_NSITRANSACTION \
  85.   NS_IMETHOD DoTransaction(void); \
  86.   NS_IMETHOD UndoTransaction(void); \
  87.   NS_IMETHOD RedoTransaction(void); \
  88.   NS_IMETHOD GetIsTransient(PRBool *aIsTransient); \
  89.   NS_IMETHOD Merge(nsITransaction *aTransaction, PRBool *_retval); 
  90.  
  91. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  92. #define NS_FORWARD_NSITRANSACTION(_to) \
  93.   NS_IMETHOD DoTransaction(void) { return _to DoTransaction(); } \
  94.   NS_IMETHOD UndoTransaction(void) { return _to UndoTransaction(); } \
  95.   NS_IMETHOD RedoTransaction(void) { return _to RedoTransaction(); } \
  96.   NS_IMETHOD GetIsTransient(PRBool *aIsTransient) { return _to GetIsTransient(aIsTransient); } \
  97.   NS_IMETHOD Merge(nsITransaction *aTransaction, PRBool *_retval) { return _to Merge(aTransaction, _retval); } 
  98.  
  99. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  100. #define NS_FORWARD_SAFE_NSITRANSACTION(_to) \
  101.   NS_IMETHOD DoTransaction(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->DoTransaction(); } \
  102.   NS_IMETHOD UndoTransaction(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->UndoTransaction(); } \
  103.   NS_IMETHOD RedoTransaction(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->RedoTransaction(); } \
  104.   NS_IMETHOD GetIsTransient(PRBool *aIsTransient) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetIsTransient(aIsTransient); } \
  105.   NS_IMETHOD Merge(nsITransaction *aTransaction, PRBool *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->Merge(aTransaction, _retval); } 
  106.  
  107. #if 0
  108. /* Use the code below as a template for the implementation class for this interface. */
  109.  
  110. /* Header file */
  111. class nsTransaction : public nsITransaction
  112. {
  113. public:
  114.   NS_DECL_ISUPPORTS
  115.   NS_DECL_NSITRANSACTION
  116.  
  117.   nsTransaction();
  118.  
  119. private:
  120.   ~nsTransaction();
  121.  
  122. protected:
  123.   /* additional members */
  124. };
  125.  
  126. /* Implementation file */
  127. NS_IMPL_ISUPPORTS1(nsTransaction, nsITransaction)
  128.  
  129. nsTransaction::nsTransaction()
  130. {
  131.   /* member initializers and constructor code */
  132. }
  133.  
  134. nsTransaction::~nsTransaction()
  135. {
  136.   /* destructor code */
  137. }
  138.  
  139. /* void doTransaction (); */
  140. NS_IMETHODIMP nsTransaction::DoTransaction()
  141. {
  142.     return NS_ERROR_NOT_IMPLEMENTED;
  143. }
  144.  
  145. /* void undoTransaction (); */
  146. NS_IMETHODIMP nsTransaction::UndoTransaction()
  147. {
  148.     return NS_ERROR_NOT_IMPLEMENTED;
  149. }
  150.  
  151. /* void redoTransaction (); */
  152. NS_IMETHODIMP nsTransaction::RedoTransaction()
  153. {
  154.     return NS_ERROR_NOT_IMPLEMENTED;
  155. }
  156.  
  157. /* readonly attribute boolean isTransient; */
  158. NS_IMETHODIMP nsTransaction::GetIsTransient(PRBool *aIsTransient)
  159. {
  160.     return NS_ERROR_NOT_IMPLEMENTED;
  161. }
  162.  
  163. /* boolean merge (in nsITransaction aTransaction); */
  164. NS_IMETHODIMP nsTransaction::Merge(nsITransaction *aTransaction, PRBool *_retval)
  165. {
  166.     return NS_ERROR_NOT_IMPLEMENTED;
  167. }
  168.  
  169. /* End of implementation class template. */
  170. #endif
  171.  
  172.  
  173. #endif /* __gen_nsITransaction_h__ */
  174.